﻿<!doctype html>
<html lang="en">
<!-- 参考url:http://www.runoob.com/jqueryui/example-datepicker.html -->
<head>
  <meta charset="utf-8">
  <title>jQuery UI 日期选择器（Datepicker） - 格式化日期</title>
  <link rel="stylesheet" href="http://apps.bdimg.com/libs/jqueryui/1.10.4/css/jquery-ui.min.css">
  <script src="http://apps.bdimg.com/libs/jquery/1.10.2/jquery.min.js"></script>
  <script src="http://apps.bdimg.com/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
  <link rel="stylesheet" href="http://www.runoob.com/try/demo_source/jqueryui/style.css">
  <script>
  $(function() {
	  $("#datepicker").datepicker();
	  $('#datepicker').datepicker('option', 'monthNames', ['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月']);  
	  $('#datepicker').datepicker('option', 'dateFormat', 'yy-mm-dd');  
	  $('#datepicker').datepicker('option', 'dayNamesMin', ['日', '一', '二', '三', '四', '五', '六']);
	  $('#datepicker').datepicker('option', 'dayNames', ['日', '一', '二', '三', '四', '五', '六']);
	  $("#datepicker").datepicker("option","minDate","2016-10-25");
    $( "#datepicker" ).datepicker();
    $( "#format" ).change(function() {
      $( "#datepicker" ).datepicker( "option", "dateFormat", $( this ).val() );
    });
	
	$('#datepicker').change(function(){
	alert("你选择了"+$('#datepicker').val())
  })
  });
  
  </script>
</head>
<body>
 
<p>日期：<input type="text" id="datepicker" size="30"></p>
 
<p>格式选项：<br>
  <select id="format">
    <option value="mm/dd/yy">Default - mm/dd/yy</option>
    <option value="yy-mm-dd">ISO 8601 - yy-mm-dd</option>
    <option value="d M, y">Short - d M, y</option>
    <option value="d MM, y">Medium - d MM, y</option>
    <option value="DD, d MM, yy">Full - DD, d MM, yy</option>
    <option value="&apos;day&apos; d &apos;of&apos; MM &apos;in the year&apos; yy">With text - 'day' d 'of' MM 'in the year' yy</option>
  </select>
</p>
 
 
</body>
</html>